<%@ page import="org.apache.struts.validator.Resources" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<% 
String ctPath = request.getContextPath();

String exitURLStr = "/loginPage.do";
String hostPageStr = "/loginPage.do";

if( ctPath.equals("/bvmc") ) {
  exitURLStr = "/cm/closeWindowAlwaysRefresh.do";
  hostPageStr = "/cm/pageFlowContainer.do";
}
%>

<script language="javascript">

function onClickAcceptAndStart(theForm) {
  theForm.action.value = "CLAIM_EXECUTE_NOW";
  theForm.exitURL.value = "<%=exitURLStr%>";
  theForm.submit();
}

function onClickAccept(theForm) {
  theForm.action.value = "CLAIM_EXECUTE_LATER";
  theForm.submit();
}

</script>


<jsp:useBean id="processTaskForm"
          class="com.broadvision.bpmapp.action.ProcessTaskForm"
          scope ="request"/>

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">

      <div class="app_pageTitle">
        <span class="left"><bean:message bundle="appCommonRes" key="bp.groupAnyTask.title" /></span>
      </div> 
		    
      <div class="app_pageSubtitle">
        <span class="left"><bean:message bundle="appCommonRes" key="bp.groupAnyTask.title" /></span>
      </div> 
			
			<div class="blockWrap">
      <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0" summary="Account information">
        <tr> 
          <td class="label" width="20%"><bean:message bundle="appCommonRes" key="bp.name" />:</td>
          <td class="labelField" width="80%"><bean:write name="processTaskForm" property="name" /></td>
        </tr>

        <tr> 
          <td class="label" width="20%"><bean:message bundle="appCommonRes" key="bp.dueDate" />:</td>
          <td class="labelField" width="80%">
            <bean:write name="processTaskForm" property="dueDate" formatKey="format.datetime.full" />
          </td>
        </tr>

        <tr> 
          <td class="label" width="20%"><bean:message bundle="appCommonRes" key="bp.priority" />:</td>
          <td class="labelField" width="80%">
           <bean:define id="processTaskpriority" name="processTaskForm" property="priority"/>
	   <% String  priority = (String )pageContext.getAttribute("processTaskpriority"); %>
	   <%=  Resources.getMessage(request,priority) == null ? priority : Resources.getMessage(request,priority) %> 
          </td>
        </tr>

        <tr> 
          <td class="label" width="20%"><bean:message bundle="appCommonRes" key="bp.processInstance.search.processName" />:</td>
          <td class="labelField" width="80%">
            <bean:write name="processTaskForm" property="processName" />
          </td>
        </tr>

        <tr> 
          <td class="label" width="20%"><bean:message bundle="appCommonRes" key="bp.processInstance.search.processInstanceName" />:</td>
          <td class="labelField" width="80%">
            <bean:write name="processTaskForm" property="processInstanceName" />
          </td>
        </tr>

        <tr> 
          <td class="label" width="20%"><bean:message bundle="appCommonRes" key="bp.instructions" />:</td>
          <td class="labelField" width="80%">
            <bean:write name="processTaskForm" property="instructions" />
          </td>
        </tr>
      </table>

      <html:form action="/claimGroupAnyTask.do" method="post">

        <div class="pageButtonWrap" align="right">

          <%-- hidden fields to submit --%>
          <input type="hidden" name="task_id" value='<bean:write name="processTaskForm" property="taskID" />'>
          <input type="hidden" name="action" >
          <input type="hidden" name="hostPage" value="<%=hostPageStr%>" >
          <input type="hidden" name="exitURL" >

          <input type="button" class="pageButton" 
                 name="acceptAndStartBtn"
                 value='<bean:message bundle="appCommonRes" key="bp.acceptAndStart" />'
                 onClick="onClickAcceptAndStart(this.form)" >

          <input type="button" class="pageButton" 
                 name="acceptBtn"
                 value='<bean:message bundle="appCommonRes" key="bp.accept" />'
                 onClick="onClickAccept(this.form)" >

        </div>
      </html:form>
			</div> 
    </td>
  </tr>
</table>

